package com.tiancheng.onecode.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tiancheng.onecode.entity.MemberOrder;
import com.tiancheng.onecode.entity.User;
import com.tiancheng.onecode.model.request.admin.MerchantUserQueryReq;
import com.tiancheng.onecode.model.request.admin.QueryOrderReq;
import com.tiancheng.onecode.model.request.admin.StatisticsMerchantOrderReq;
import com.tiancheng.onecode.model.request.admin.StatisticsUserOrderReq;
import com.tiancheng.onecode.model.response.admin.*;
import com.tiancheng.onecode.model.response.api.QueryOrderDetailApiRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: kellen
 * @Description: 会员订单-主订单
 * @Date: create in 2024/12/9 18:11
 */
@Mapper
public interface MemberOrderMapper extends MYBaseMapper<MemberOrder> {
    IPage<QueryOrderRes> queryPage(IPage<MemberOrder> page, @Param("c") QueryOrderReq params);

    /**
     * 按天统计商户订单
     * @param statisticsMerchantOrderReq
     * @return
     */
    List<StatisticsMerchantOrderPayRes> statisticsByMerchant(StatisticsMerchantOrderReq statisticsMerchantOrderReq);

    /**
     * 总交易金额
     * @param platformMerchantId 平台关联商户id
     * @return
     */
    Integer totalPayAmount(@Param("platformMerchantId")Long platformMerchantId);
    /**
     * 当天总交易金额
     * @param platformMerchantId 平台关联商户id
     * @return
     */
    Integer todayPayAmount(@Param("platformMerchantId")Long platformMerchantId);

    /**
     * 查询客户端订单明细
     * @param orderId
     * @return
     */
    QueryOrderDetailApiRes queryApiOrderDetail(@Param("userId")String userId,@Param("orderId")String orderId);

    /**
     *按天统计用户订单
     * @param statisticsUserOrderReq
     * @return
     */
    List<StatisticsUserOrderItemRes> statisticsByUserId(StatisticsUserOrderReq statisticsUserOrderReq);

    /**
     * 按天统计
     * @param statisticsMerchantOrderReq
     * @return
     */
    List<StatisticsMerchantOrderPayRes> statisticsByDay(StatisticsMerchantOrderReq statisticsMerchantOrderReq);
}
